package com.abk.ets.data;

// Generated 26 avr. 2013 10:28:47 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Contrat generated by hbm2java
 */
@Entity
@Table(name = "contrat", catalog = "etsdatabase")
public class Contrat implements java.io.Serializable {

	private int idcontrat;
	private Societe societe;
	private String typeContrat;
	private int montantContrat;
	private Date dateCreation;
	private Date dateMarche;
	private Date dateVente;
	private String etatContrat;
	private String libelleContrat;
	private Set offres = new HashSet(0);

	public Contrat() {
	}

	public Contrat(int idcontrat, String typeContrat, int montantContrat,
			Date dateCreation, String etatContrat) {
		this.idcontrat = idcontrat;
		this.typeContrat = typeContrat;
		this.montantContrat = montantContrat;
		this.dateCreation = dateCreation;
		this.etatContrat = etatContrat;
	}

	public Contrat(int idcontrat, Societe societe, String typeContrat,
			int montantContrat, Date dateCreation, Date dateMarche,
			Date dateVente, String etatContrat, String libelleContrat,
			Set offres) {
		this.idcontrat = idcontrat;
		this.societe = societe;
		this.typeContrat = typeContrat;
		this.montantContrat = montantContrat;
		this.dateCreation = dateCreation;
		this.dateMarche = dateMarche;
		this.dateVente = dateVente;
		this.etatContrat = etatContrat;
		this.libelleContrat = libelleContrat;
		this.offres = offres;
	}

	@Id
	@Column(name = "idcontrat", unique = true, nullable = false)
	public int getIdcontrat() {
		return this.idcontrat;
	}

	public void setIdcontrat(int idcontrat) {
		this.idcontrat = idcontrat;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idSociete")
	public Societe getSociete() {
		return this.societe;
	}

	public void setSociete(Societe societe) {
		this.societe = societe;
	}

	@Column(name = "typeContrat", nullable = false, length = 3)
	public String getTypeContrat() {
		return this.typeContrat;
	}

	public void setTypeContrat(String typeContrat) {
		this.typeContrat = typeContrat;
	}

	@Column(name = "montantContrat", nullable = false)
	public int getMontantContrat() {
		return this.montantContrat;
	}

	public void setMontantContrat(int montantContrat) {
		this.montantContrat = montantContrat;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateCreation", nullable = false, length = 10)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateMarche", length = 10)
	public Date getDateMarche() {
		return this.dateMarche;
	}

	public void setDateMarche(Date dateMarche) {
		this.dateMarche = dateMarche;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateVente", length = 10)
	public Date getDateVente() {
		return this.dateVente;
	}

	public void setDateVente(Date dateVente) {
		this.dateVente = dateVente;
	}

	@Column(name = "etatContrat", nullable = false, length = 5)
	public String getEtatContrat() {
		return this.etatContrat;
	}

	public void setEtatContrat(String etatContrat) {
		this.etatContrat = etatContrat;
	}

	@Column(name = "libelleContrat", length = 50)
	public String getLibelleContrat() {
		return this.libelleContrat;
	}

	public void setLibelleContrat(String libelleContrat) {
		this.libelleContrat = libelleContrat;
	}

	@OneToMany(fetch = FetchType.LAZY, targetEntity=Offre.class, mappedBy="contrat")
	public Set getOffres() {
		return this.offres;
	}

	public void setOffres(Set offres) {
		this.offres = offres;
	}

}
